function getDate() {
    var date = new Date()
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    var dates = date.getDate();
    var arr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
    var day = date.getDay()
    return year + '年' + month + '月' + dates + '日  ' + arr[day]
}
var el_date = document.querySelector('.date')
el_date.innerHTML = getDate()
var el_h = document.querySelector('.h')
var el_m = document.querySelector('.m')
var el_s = document.querySelector('.s')
// 开启定时器
getTime() //先调用一次，防止第一次刷新页面空白
setInterval(getTime, 1000)
function getTime() {
    var date = new Date();
    var h = date.getHours();
    h = h < 10 ? '0' + h : h;
    el_h.innerHTML = h + ':'
    var m = date.getMinutes();
    m = m < 10 ? '0' + m : m;
    el_m.innerHTML = m + ':'
    var s = date.getSeconds();
    s = s < 10 ? '0' + s : s;
    el_s.innerHTML = s
}

var app = new Vue({
    el: "#app",
    data: {
        base_url: "http://kunvm1.ap.health.ge.com:8089",
        interfaces: ["/return_interface"],
        query_result: ""
    },
    methods: {
        query_interface: function (route) {
            let url = this.base_url + route
            let that = this
            if (route == "/return_interface") {
                axios.get(url).then(
                    (response) => {
                        that.interfaces = response.data
                        that.query_result = response.data
                    },
                    (err) => { console.log(err) }
                )
            } else {
                console.log(url)
                axios.get(url).then(
                    (response) => {
                        that.query_result = response.data
                    },
                    (err) => { console.log(err) }
                )
            }
        },
        logout: function(){
            let url = this.base_url + "/logout"
            let that = this
            axios.get(url).then(
                (response) => {
                    window.location = that.base_url
                },
                (err) => { console.log(err) }
            )
        }
    }
})